package com.hrm.common.controller;

import com.hrm.common.entity.Result;
import com.hrm.common.entity.ResultCode;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 林海湾Sea
 * @Date :  2021/12/27 17:29
 * @Decription: 公共错误跳转
 */

@RestController
@CrossOrigin
public class ErrorController {

    /**
     * 公共错误跳转
     * @param code
     * @return
     */
    @RequestMapping(value = "autherror")
    public Result autherror(int code) {
        return code == 1?new Result(ResultCode.UNAUTHENTICATED):new Result(ResultCode.UNAUTHORISE);
    }
}
